package com.xsir.mapper;

import com.xsir.entity.Category;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author xsir
 * @since 2020-11-03
 */
@Repository
public interface CategoryMapper extends BaseMapper<Category> {
    
    /**
     * 添加一条类别记录，并把主键赋值给Category的id属性
     * @param category 类别实例
     * @return  受影响的行
     */
    int insertKey(Category category);
    
    /**
     * 查找文章的类别
     * @param articleId 文章编号
     */
    Category selectByArticle(@Param("articleId") Integer articleId);
}
